package com.clstu.homework;

import java.io.*;

public class Homework02 {
    public static void main(String[] args) throws IOException {
        //BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\fuBen.txt"));

        //FileInputStream -> InputStreamReader[可以指定编码] -> BufferedReader  //转换过程
        BufferedReader bufferedReader = new BufferedReader(//节点转换流 设置好编码格式就可以正常读入了
                                        new InputStreamReader(new FileInputStream("D:\\fuBen.txt"), "gbk"));
        String line = null;
        int lineNo = 0;
        while ((line=bufferedReader.readLine())!=null){
            System.out.println((++lineNo)+":   "+line);
        }
        if(bufferedReader!=null) {
            bufferedReader.close();
        }
    }
}
